<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>盛世机电</title>
    <link href="/common/css/common-ui.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="/css/backstageManage/projectInfo.css" />
    <script>
        if(localStorage.getItem("token")==null){
            window.history.replaceState(null, "", '/login.html');
            location.reload()
        }
    </script>
</head>

<body>
    <div class="page-container">
        <div class="side-menu"></div>
        <div class="main-container">
            <div class="header-content">
                <i class="aidicon aidicon-backburger"></i>
                <span class="title-text"></span>
                <div class="user-info pull-right">
                    <img src="/images/backstageManage/img_01.png">
                    <span class="username"></span>
                </div>
            </div>
            <div class="main-content">
                <div class="main-wrapper">
                    <div class="standard-table-btn-con">
                        <button type="button" class="btn btn-primary m-right" id="add">新增</button>

                        <div class="right-operate-con">
                            <select id="relatePro" data-placeholder="所属项目">
                                <option></option>
                            </select>
                            <div class="searchbox m-right">
                                <span class="aidicon aidicon-magnify"></span>
                                <input id="search_val" placeholder="请输入搜索内容" />
                                <span class="aidicon aidicon-close"></span>
                            </div>
                        </div>
                    </div>
                    <div class="standard-table-body-con">
                        <table id="standard_table" class="display" cellspacing="0" width="100%"
                            style="table-layout: fixed;">

                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script id="addFormTpl" type="text/html">
        <div class="form-default">
            <form class="form-validate-dom addForm">
                {{if data.id}}
                <input type="hidden" id="id1" value="{{data.id}}"/>
                {{/if}}
                <label for="name"><i>*</i>设备保养名称</label>
                <div class="form-group">
                    <input type="text" class="form-control" id="name1" name="name" placeholder="请输入" required autocomplete="off" value="{{data.name}}">
                </div>  
                <label for="equipmentId"><i>*</i>关联设备（仅关联一项）</label>
                <div class="form-group">
                    <select id="equipmentId" class="form-control" data-placeholder="请选择" name="equipmentId" required></select>
                </div>
                <label for="modelNum"><i>*</i>设备型号</label>
                <div class="form-group">
                    <input type="text" class="form-control" id="modelNum" name="modelNum" placeholder="请输入" required autocomplete="off" value="{{data.modelNum}}">
                </div>
                <label for="maintainNumber"><i>*</i>保养台数</label>
                <div class="form-group">
                    <input type="text" class="form-control" id="maintainNumber" name="maintainNumber" placeholder="请输入" autocomplete="off" value="{{data.maintainNumber}}" required>
                </div> 
                <label for="description">备注</label>
                <div class="form-group">
                    <textarea type="text" class="form-control" id="description" name="description" placeholder="请输入" autocomplete="off">{{data.description}}</textarea>
                </div> 
            </form> 
        </div>
    </script>
    <div id="editModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="editModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">新增或者编辑参数</h4>
                </div>
                <div class="modal-body">
                    <div class="form-default">
                        <form class="form-validate-dom" id="paramForm">
                            <input id="id" type="hidden" value=""/>
                            <label for="name"><i>*</i>参数名称</label>
                            <div class="form-group">
                                <input type="text" class="form-control" id="name" name="name" required
                                    placeholder="请输入" autocomplete="off" value="">
                            </div>
                            <label for="value"><i>*</i>数值</label>
                            <div class="form-group">
                                <input type="text" class="form-control" id="value" name="value" required
                                    placeholder="请输入" autocomplete="off" value="">
                            </div>
                            <label for="sort"><i>*</i>序号(小值优先显示)</label>
                            <div class="form-group">
                                <input type="text" class="form-control" id="sort" name="sort" required
                                    placeholder="请输入" autocomplete="off" value="">
                            </div>
                        </form>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary saveOrUpdateClassName">保存</button>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
    <script id="classifyTpl" type="text/html">
        <div class="search-wrap">
            <button type="button" class="btn btn-primary" id="addClassify" data-toggle="modal" data-target="#editModal">新增</button>
        </div>
        <table id="grid-demo-1" class="display" cellspacing="0" width="100%" style="table-layout: fixed;"></table>
    </script>

    <script src="/common/js/lib/require/require.min.js"></script>
    <script>
        require(["/js/require.config.js"], function () {
            require(["/js/backstageManage/menu.js"], function () {
                require(["/js/backstageManage/equipmentMaintain.js"], function (app) {
                    app.init();
                });
            });
        });
    </script>
</body>

</html>